package com.lysj.website.leshua.service;

import com.lysj.website.common.spring.base.BaseRepository;
import com.lysj.website.common.spring.base.BaseService;
import com.lysj.website.leshua.domain.LeShuaBank;
import com.lysj.website.leshua.repository.LeShuaBankRepository;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author lb
 * @date 2019/11/13 17:38
 * @Description
 */
@Service
@Slf4j
public class LsMchInfoService implements BaseService<LeShuaBank> {

    @Resource
    private LeShuaBankRepository leShuaBankRepository;

    @Override
    public LeShuaBankRepository getRepository() {
        return leShuaBankRepository;
    }

    //查找支行信息
    public List<LeShuaBank> findBankName(String bankName){

        List<LeShuaBank> byFullBankNameLike = leShuaBankRepository.findByFullBankNameLike("%" + bankName + "%");
        if (byFullBankNameLike.size()<=200){
            return byFullBankNameLike;
        }else {
            return null;
        }

    }

}

